# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=ispc
pkgver=1.25.2
pkgrel=0
pkgdesc="Intel SPMD Program Compiler"
url="https://ispc.github.io/"
arch="x86_64 aarch64" # ispc only supports these arches
license="BSD-3-Clause"
_llvmver=19
makedepends="cmake
	bison
	clang$_llvmver-dev
	flex
	llvm$_llvmver-dev
	llvm$_llvmver-test-utils
	m4
	python3
	samurai
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/ispc/ispc/archive/v$pkgver.tar.gz"
options="!check" # ctest does not find a testsuite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DLLVM_CONFIG_EXECUTABLE="/usr/lib/llvm$_llvmver/bin/llvm-config" \
		-DISPC_INCLUDE_EXAMPLES=OFF \
		-DISPC_INCLUDE_RT=OFF \
		-DISPC_SLIM_BINARY=ON

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
29c0adb0d28be280ef6223253f34eaeae6530d4ab63f67c94791837144eb20a2d596b0bd450188841b86f277d9f7d68a96b3c1e9e25297590e496d7f04ad55c3  ispc-1.25.2.tar.gz
"
